﻿using System.ComponentModel;
using Game.Types;

namespace Game.Command
{
    public abstract class SchedulerCommand : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        bool _IsEnabled;

        public abstract string Name { get; }

        public abstract ScheduledCommand CreateScheduledCommand(VehicleType vehicle);

        public virtual bool IsEnabled
        {
            get { return _IsEnabled; }
            protected set
            {
                _IsEnabled = value;
                FirePropertyChanged();
            }
        }

        void FirePropertyChanged()
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs("IsEnbled"));
            }
        }

    }
}
